home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-01-12 | 3.9 KB | 53 lines | [TEXT/MPS ] |
- The USB Storage Driver sample contains three parts: the Shim, the native UnitTable driver and the Storage Class Driver.
- When the driver is built, there will be two extensions: the Shim and the Class Driver. ( For easy identification and to
- avoid user confusion, the name of the drive that the drivers are built for should be used in the names of these extensions)
-
- About the Shim:
- The Shim extension actually contains both the Shim and the UnitTable driver. The Shim is loaded by the USB Family Expert
- during startup and registers to be notified when its device is attached or removed.
-
- When the shim is notified that a device has been attached, it loads the UnitTable driver into memory, installs it into the
- UnitTable and opens the driver.
-
- Once the UnitTable driver is loaded, the Shim makes a control call to the UnitTable driver to inform it of the address of
- the dispatach table for its Class Driver.
-
- When the Shim is notified that the device is removed, it will check to see if there are a mounted volume belonging to
- the UnitTable Driver. If there is, the Shim will try to unmount it. If the volume can not be unmounted, (open files, or
- disk cache information that needs to be flushed) the Shim will offline (ghost) the volume. When a volume is offlined,
- the system will post a dialog saying to reinsert the disk if it needs access to information on the device. When this dialog
- is displayed, the device can be reattached and the system will online the volume and remove the dialog.
-
- About the UnitTable Driver:
- The UnitTable driver handles all operating system and device specific actions. The UnitTable driver is fully native or a
- 'ndrv' and follows the structure for native drivers as described in the "Designing PCI Cards and Drivers for Power Macintosh
- Computers". Since it is a native driver, the UnitTable uses the utilites provided by the Driver Services Library (DSL).
- Several differences of the UnitTable driver over the old model or 'DRVR' drivers are:
- 1) native drivers do not directly access their DCEs and must use the services provided by the DSL to set DCE fields
- 2) native drivers do not get accRun calls, therefore they must use interrupt timers provided by the DSL to get time
- 3) the UnitTable driver does not use VBL task, again, it uses the interrupt timer functions provided by the DSL
- 4) native drivers can fully access any internal global variables without needing to set up or switch A5Worlds
- 5) the DeviceManager directs all driver access calls through the DoDriverIO function, therefore no 68000 assembly code
- is needed to set up the offsets to the Open,Prime,Status,Control and Close routines
-
- The UnitTable driver is bus independent and does not know about USB structures and protocols. All commands are passed
- to the Class Driver to be sent to the USB subsystem.
-
- About the Class Driver:
- The class drivers only job is to handle the transaction between the UnitTable driver and the USB subsystem. The class
- driver does not know anything about the device or device commands. The class driver just takes the command passed to
- it by the UnitTable driver and embeds it into a USB Device Request to send to the device.
-
- The class driver has a dispatch table that the UnitTable driver uses to communicate with the class driver. The dispatch
- table and parameter blocks are defined in the Storage Class' API header file.
-
- The class driver is automatically loaded by the USB subsystem when a device that matches the device information in the
- TheUSBDriverDescription that the class driver exports, and automatically removed when the device it was loaded for is
- removed.
-
- About Device Information:
- All USB device information used to identifed which device the Shim needs to be notified for and the class driver needs
- to be loaded for are contained in the SampleStorageDeviceID.h header file. This file contains constants that are used
- any time the Shim or Class driver needs the exact device information. This file contains the VendorID, ProductID, ClassID
- and SubClassID.
-